
int test_ComplexStruct_get_serialized_data_size(test_ComplexStruct* data, unsigned int currentAlignment) {
    return test_ComplexStructTypeSupport::get_instance()->get_serialized_data_size(data, currentAlignment);
}

int test_ComplexStruct_serialize(test_ComplexStruct* data, char* buffer, unsigned int bufferSize) {
    SerializedBuffer cdrBuffer;
    cdrBuffer.buffer = buffer;
    cdrBuffer.buffer_size = bufferSize;
    AGIDDSCdrSerializer cdr(&cdrBuffer);
    if (test_ComplexStructTypeSupport::get_instance()->serialize_data(data, &cdr, 0) != 0) {
        fprintf(stderr, "Serialization failed\n");
        return -1;
    }
    return 0;
}

// deserialize函数
int test_ComplexStruct_deserialize(test_ComplexStruct* data, const char* buffer, unsigned int bufferSize) {
    SerializedBuffer cdrBuffer;
    cdrBuffer.buffer = (char*)buffer;
    cdrBuffer.buffer_size = bufferSize;
    cdrBuffer.writer_position = bufferSize;
    cdrBuffer.reader_position = 0;
    AGIDDSCdrDeserializer cdr(&cdrBuffer);
    if (test_ComplexStructTypeSupport::get_instance()->deserialize_data(data, &cdr, 0) != 0) {
        fprintf(stderr, "Deserialization failed\n");
        return -1;
    }
    return 0;
}